<?php
class makeReport extends CWidget {

    /**
     *
     * attribute is associate in array with $key=>$value
     *
     * $key available are
     * value -> Text/value of the icon
     * url -> The URL link of the icon. default is set to '#'
     * icon -> The CSS class name of the jquery icon, array for primary and secondary icon
     * click -> Icon click event. 
     *
     * @var array
     */
    
    public $pdf = false;
    
    public $template="{items}";
    
    public $line=15;
    
    public $logoLink = '';
    
    public $companyName = '';
    
    public $companyAddress = '';
    
    public $companyInfo = '';
    
    public $companyContact = '';
    
    private $params;
    
    public function init() {
    	$this->checkInfo();
    	$this->render('standard_header',array('params'=>$this->params));
    }
    public function run(){
    	$this->render('standard_footer', array('params'=>$this->params));
    }
    private function checkInfo() {
    	$admin = admin::model()->find('domain=:domain',array(':domain'=>Yii::app()->session->get('domain')));
    	if($this->logoLink == '')
    		$this->params['logo'] = 'http://spartanlogistics.biz/'.$admin->logo;
    	if($this->companyName == '')
    		$this->params['cname'] = $admin->cname;
    	if($this->companyAddress == '')
    		$this->params['address'] = $admin->address;
    	if($this->companyContact == '')
    		$this->params['contacts'] = $admin->contacts;
    	if($this->companyInfo == '')
    		$this->params['info'] = $admin->info;
    }
}
?>